import store from "@/store/index";
const quitFun = () => {
  // 退出
  const thirdPartyUrl = store.state.common.thirdPartyUrl;
  if (thirdPartyUrl && thirdPartyUrl.length > 0) {
    // 返回第三方登录的来源地址
    window.location.replace(thirdPartyUrl);
    window.history.replaceState();
  } else {
    const Secret = sessionStorage.getItem("Secret");
    if (window.opener) {
      window.close();
    }
    const href = location.origin;
    window.location.replace(`${href}${Secret ? `?Secret=${Secret}` : ""}`);
  }
  sessionStorage.clear();
};
export { quitFun };
